package com.yuexun.dhdoctor.module.main.model.impl;


import com.yuexun.dhdoctor.module.main.api.UpdateApi;
import com.yuexun.dhdoctor.module.main.bean.UpdateBean;
import com.yuexun.dhdoctor.module.main.model.IUpdateModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import rx.Observable;

/**
 * Created by work-jx on 2016/9/20.
 */
public class UpdateModel implements IUpdateModel {
    private UpdateApi api;

    public UpdateApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi_Update(UpdateApi.class);
        }
    }

    @Override
    public Observable<UpdateBean> update() {
        api = ApiInstance();
        return api.update();
    }
}
